home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / t3_1 / encore.lha / encore / tsystem / maxbuild.t < prev    next >
Text File  |  1988-03-11  |  5KB  |  154 lines

  1. (herald maxbuild)
  2. #|
  3.  
  4. To build a new system from sources:
  5.  
  6. 1. You should be in a directory with sources and tsystem as subdirectories
  7.    Execute the shell script in tsystem/envset
  8. 2. Start up tsystem/xt and load this file into orbit-env
  9. 3. (compile-support) and (exit)
  10. 4. Start up tsystem/xt again and load this file into orbit-env
  11. 5. (compile-sources) and (link-t '(tsystem new)) and (exit)
  12. 6. cd tsystem; linkt new.o new; cd ..
  13. 7. tsystem/new is a T without compiler. Start up new with a large heap.
  14. 8. ((*value t-implementation-env 'load-and-suspend-system) '(tsystem new) t)
  15.    (exit)
  16. 9. cd tsystem; linkt new.o new    That's it.
  17.  
  18. |#
  19.  
  20. ;;; Build compiler early binding environment
  21.  
  22. (*define user-env 'compile-support
  23. (lambda ()     
  24. (create-support '(t3_primops nconstants) '(t3_primops nconstants))
  25. (load '(t3_primops nconstants t) orbit-env)
  26. (orbit-n32-setup 't3_primops)
  27. (orbit-init 'base)
  28. (set (orbit-syntax-table) primop-syntax-table)
  29. (set *compile-primops?* nil)
  30. (create-support '(t3_primops n32primops)   '(t3_primops n32primops))
  31. (create-support '(t3_primops n32arith)     '(t3_primops n32arith))
  32. (create-support '(t3_primops locations)    '(t3_primops locations))
  33. (create-support '(t3_primops n32low)       '(t3_primops n32low))
  34. (create-support '(t3_primops predicates)       '(t3_primops predicates))
  35. (orbit-init 'base  
  36.             'constants 'primops 'arith 'locations 'low 'predicates)
  37. (create-support '(t3_primops open)    '(t3_primops open))
  38. (create-support '(t3_primops aliases) '(t3_primops aliases))
  39. (create-support '(t3_primops carcdr)  '(t3_primops carcdr))
  40. (create-support '(t3_primops n32genarith)  '(t3_primops n32genarith))))
  41.  
  42. ;;; compile compiler code in early binding environment, runtime system
  43.  
  44. (*define user-env 'compile-sources
  45. (lambda ()
  46. (set (orbit-syntax-table) primop-syntax-table)
  47. (comfile '(t3_primops base))
  48. (compile-primop-source '(t3_primops n32primops   ni))
  49. (compile-primop-source '(t3_primops n32arith     ni))
  50. (compile-primop-source '(t3_primops locations    ni))
  51. (compile-primop-source '(t3_primops n32low       ni))
  52. (compile-primop-source '(t3_primops n32genarith    ni))
  53. (set *compile-primops?* nil)
  54. (set (table-entry *modules* 'bignum) '(osys n32_bignum))
  55. (load-quietly '(t3_primops nconstants t) orbit-env)
  56. (set (orbit-syntax-table) (env-syntax-table t-implementation-env))
  57. (orbit-n32-init 't3_primops)
  58. (define (comsys system . start)
  59.   (walk (lambda (file)
  60.       (xcase (car file)
  61.             ((osys)
  62.          (set (tc-syntax-table) (env-syntax-table t-implementation-env))
  63.          (comfile file))
  64.         ((t3_primops)
  65.          (set (tc-syntax-table) primop-syntax-table)
  66.          (bind ((write-support-file false))
  67.            (comfile file)))))
  68.     (let ((files (xcase system
  69.                ((z) *zvm-system*)
  70.                ((t) *t-system*))))
  71.       (if start (mem alikev? (car start) files) files))))
  72. (load '(osys max_files) orbit-env)
  73. (comsys 't)
  74. (comfile '(link defs))
  75. (comfile '(link linker))
  76. (comfile '(link max_link))
  77. (comfile '(link lp_table))
  78. (comfile '(link suspend))
  79. (comfile '(link maxsuspend))
  80. (comfile '(tscheme scheme))
  81. (comfile '(tscheme syntax))
  82. (comfile '(tscheme system))
  83. (comfile '(tscheme runtime))
  84. (comfile '(tscheme compiler))
  85. (set (tc-syntax-table) (env-syntax-table orbit-env))
  86. (walk (lambda (x) (load x orbit-env))
  87.              '((assembler expand)
  88.              (assembler compile_fgs)
  89.              (assembler as_syntax)
  90.              (assembler as_utils)
  91.              ))
  92.  
  93. (walk comfile
  94.       (append *orbit-files*
  95.           *top-files*
  96.           *front-files*
  97.           *back-end-files*
  98.           *orbit-n32-files*
  99.                '((assembler as_open)
  100.                 (assembler ib)
  101.         (assembler expand)
  102.                 (assembler as_utils)
  103.                 (assembler compile_fgs)
  104.                 (assembler as_syntax)
  105.                 (assembler fg)
  106.                 (assembler lap)
  107.                 (assembler as)
  108.                 (assembler count)
  109.                 (assembler mark)
  110.                 (assembler mini)
  111.                 (assembler bits)
  112.                 (assembler listing)
  113.         (back_end unn32gen))
  114.           *tas-n32-files*))))
  115.  
  116. (define (load-linker . system)
  117.   (let* ((system (if (null? system) 
  118.                      ((*value t-implementation-env 'machine-type) 
  119.                       ((*value t-implementation-env 'local-machine)))
  120.                      (car system)))
  121.          (link-env (make-locale orbit-env 'link-env)))
  122.     (*define standard-env 'link-env link-env)
  123.     (load '(link defs )         link-env)
  124.     (load '(link linker )       link-env)
  125.     (load 
  126.      (case system
  127.        ((aegis) '(link aegis_link ))
  128.        ((sun)   '(link sun_link ))
  129.        ((max)   '(link max_link))
  130.        ((hp)    '(link hp_link ))
  131.        ((vax)   '(link unvax_link ))
  132.        ((mac)    '(link mac_link))
  133.        (else    (error "unknown system - ~a" system)))
  134.      link-env)
  135.     (load
  136.      (case system
  137.        ((vax) '(t3_primops vconstants t))
  138.        ((max) '(t3_primops nconstants))
  139.        (else '(t3_primops mconstants t)))
  140.      link-env)
  141.     (*define standard-env  'link
  142.          (lambda (files outfile)
  143.            (set (repl-results) nil)
  144.            (gc)
  145.            ((*value link-env 'link) files outfile)))))
  146.  
  147. (*define user-env 'link-t
  148. (lambda (file)
  149. (load-linker)
  150. (load '(osys max_files) orbit-env)
  151. (link *t-system* file)))
  152.  
  153.  
  154.